package loan.calc.constant.dict;

import lombok.Getter;
import loan.calc.constant.dict.base.BaseDictEnum;
import loan.calc.constant.dict.base.DictEnum;

import java.util.EnumSet;

@Getter
@DictEnum(value = "RepayScheduleType", description = "还款计划类型")
public enum RepayScheduleTypeEnum implements BaseDictEnum {

    /**
     * 还款计划定义
     */
    PI_R_PLAN(
            (byte) 1,
            "本息偿付计划",
            EnumSet.allOf(AmountTypeEnum.class),
            EnumSet.of(AmountTypeEnum.PRINCIPAL),
            EnumSet.of(AmountTypeEnum.INTEREST, AmountTypeEnum.PRINCIPAL_PENALTY, AmountTypeEnum.INTEREST_PENALTY),
            EnumSet.of(AmountTypeEnum.INTEREST),
            "1",
            "",
            DirectionTypeEnum.R,
            "0",
            ""
    ),
    UNION_PLAN(
            (byte) 2,
            "联合投资收款计划",
            EnumSet.allOf(AmountTypeEnum.class),
            EnumSet.of(AmountTypeEnum.PRINCIPAL),
            EnumSet.of(AmountTypeEnum.INTEREST, AmountTypeEnum.PRINCIPAL_PENALTY, AmountTypeEnum.INTEREST_PENALTY),
            EnumSet.of(AmountTypeEnum.INTEREST),
            "1",
            "PI",
            DirectionTypeEnum.P,
            "0",
            "01"
    ),
    UNION_FIXED_INCOME_PLAN(
            (byte) 21,
            "联合出资方固收收款计划",
            EnumSet.allOf(AmountTypeEnum.class),
            EnumSet.of(AmountTypeEnum.PRINCIPAL),
            EnumSet.of(AmountTypeEnum.INTEREST, AmountTypeEnum.PRINCIPAL_PENALTY),
            EnumSet.of(AmountTypeEnum.INTEREST),
            "1",
            "PI",
            DirectionTypeEnum.P,
            "0",
            "01"
    ),
    ;
    private final String value;
    private final Byte code;
    private final String description;
    private final EnumSet<AmountTypeEnum> amount;
    private final EnumSet<AmountTypeEnum> principalAmount;
    private final EnumSet<AmountTypeEnum> interestAmount;
    private final EnumSet<AmountTypeEnum> irrAmount;
    private final String autoPayFlag;
    private final String payItemCode;
    private final DirectionTypeEnum direction;
    private final String futurePeriod;
    private final String accountFlag;

    RepayScheduleTypeEnum(Byte code, String description, EnumSet<AmountTypeEnum> amount, EnumSet<AmountTypeEnum> principalAmount, EnumSet<AmountTypeEnum> interestAmount, EnumSet<AmountTypeEnum> irrAmount, String autoPayFlag, String payItemCode, DirectionTypeEnum direction, String futurePeriod, String accountFlag) {
        this.value = name();
        this.code = code;
        this.description = description;
        this.amount = amount;
        this.principalAmount = principalAmount;
        this.interestAmount = interestAmount;
        this.irrAmount = irrAmount;
        this.autoPayFlag = autoPayFlag;
        this.payItemCode = payItemCode;
        this.direction = direction;
        this.futurePeriod = futurePeriod;
        this.accountFlag = accountFlag;
    }
}
